import http from './request';
import mixin from './mixin';
import router from './router';
import permissions from './permissions';
import { downloadBaseUrl, deliverDownloadBaseUrl } from '@/config.js';
import {
  checkStr,
  prePage,
  paramQuery,
  msg,
  isImage,
  previewImage,
  getStatusByName,
  debounce,
  formatTime,
  openDocument,
  RSAencrypt,
  md5Str,
} from './util.js';
const $zx = {
  get: http.get,
  post: http.post,
  put: http.put,
  http,
  checkStr,
  prePage,
  paramQuery,
  msg,
  router,
  permissions,
  isImage,
  previewImage,
  downloadBaseUrl,
  deliverDownloadBaseUrl,
  getStatusByName,
  debounce,
  formatTime,
  openDocument,
  RSAencrypt,
  md5Str,
};

// 将$zx挂载到uni对象上
uni.$zx = $zx;

const install = (Vue) => {
  Vue.mixin(mixin);
  Vue.prototype.$zx = $zx;
};

export default {
  install,
};
